import logging
import unittest
from common.assertUtil import assertUtil
from api.login_api import LoginApi
from parameterized import parameterized
from common.log_code import init_log_config
from common.read_data import read_login_data


class TestLoginParam(unittest.TestCase):
    #init_log_config(filename="项目日志.log",when="midnight",interval=1,backupCount=3)

    @parameterized.expand(read_login_data())
    def test01(self, desc, req_data, success, msg):
        rsp = LoginApi.login(req_data)
        assertUtil(self, rsp, msg=msg, success=success)
    logging.info("登录测试通过")
